<template>
<div>
<ChildCom v-for="(item, index)in topics" :key= "index" >
<!-- #是 v-slot:的语法糖-->
<template #title>帖子标题:{{item.title}}</template>
<template #content>帖子内容:{{item.content }}</template>
<template #poster>发帖人:|{item. poster }}</template>
<template #ime>发帖时间:{{item. time }|</template>
</ChildCom>
</div>
</template>
<scmpt>
import ChildCom from "./eomponents/ChildCom. vue" ;
export default{
    date(){
        return{
            topics:[
                {
                    title:"我爱 Vue",
                    content:"Vue 不愧是前端王者!",
                    poster: " Jim",
                    time:"2023-11-16",
                },
                 {
                    title:"什么是插槽",
                    content:"Vue 不愧是前端王者!",
                    poster: " Jim",
                    time:"2023-11-16",
                },
                {
                    title:"组件太棒了",
                    content:"Vue 不愧是前端王者!",
                    poster: " Jim",
                    time:"2023-11-16",
                },
            ],
        };
    },
    components:{
        ChildCom
    },
};
<script >
<style>
</style>